"use strict";

const Controller = require("egg").Controller;

class QueryAllOrder extends Controller {
  // get请求
  async index() {
    try {
      let res = await this.ctx.service.adminOrder.adminQueryAllOrder();
      this.ctx.body = {
        code: 200,
        data: res
      };
    } catch (e) {
      this.ctx.body = {
        code: 500,
        data: {
          msg: "服务器错误"
        }
      };
    }
  }

  async update() {
    try {
      let res = await this.ctx.service.adminOrder.updateAdminOrder();
      this.ctx.body = {
        code: 200,
        data: res
      };
    } catch (e) {
      this.ctx.body = {
        code: 500,
        data: {
          msg: "服务器错误"
        }
      };
    }
  }
}

module.exports = QueryAllOrder;
